/**
 * @USER: Administrator
 * @DATE: 2024/9/21 上午12:57
 * @VERSION: 1.0.0
 */
public class LC744 {
    public static void main(String[] args) {

    }

    public char nextGreatestLetter(char[] letters, char target) {
        if (letters[0]>target || letters[letters.length-1]<target){
            return letters[0];
        }
        for (int i = 0; i < letters.length; i++) {
            if (letters[i]>target){
                return letters[i];
            }
        }
        return letters[0];
    }

}
